<template>
  <div>
    <h3>父组件</h3>
    <h3 v-show="sum>0">儿子给了我{{sum}}元</h3>
    <Child @money="getMoney"/>
  </div>
</template>

<script setup lang='ts' name="Father">
import { ref, reactive } from 'vue'

import Child from './Child.vue';
let sum = ref(0)
function getMoney(num:number){
sum.value += num
}

</script>


<style lang='scss' scoped>

</style>